package com.yixun.qfbao.dao;

import com.yixun.common.page.Page;
import com.yixun.qfbao.model.Department;
import com.yixun.qfbao.model.dto.DepartmentDto;

import java.util.List;
import java.util.Map;

public interface DepartmentDao {

	Page<Department> getPageModel(DepartmentDto entity,int begin,int end);
	
	List<Department> selectListByDto(DepartmentDto entity);

	List<Department> selectAllListByDto(DepartmentDto entity);

	List<DepartmentDto> selectList(DepartmentDto entity);

	Department selectByDto(DepartmentDto entity);
	
	Department selectById(Long id);
	
	Department selectBy(Department entity);
	
	DepartmentDto create(DepartmentDto entity);

	int update(DepartmentDto entity);

	int updateByMerchantId(DepartmentDto entity);

	int destroy(DepartmentDto entity);

	int saveOrUpdate(DepartmentDto entity);

	int count(DepartmentDto entity);
	
	List<Department> distinctOrgNum(DepartmentDto entity);

	DepartmentDto getPrincipal(Long staffId);

	void delDept(Long id);

	boolean hasPartner(boolean flag,long id);

	Boolean mergeDept(DepartmentDto departmentDto);

	Boolean changeDept(DepartmentDto departmentDto);
	
	List<Department> getDeptByCompCode(List<Department> deptList, String type);

	List<Department> getListByName(DepartmentDto departmentDto);

	List<Department> getListByDev(DepartmentDto departmentDto,Long devId);

	List<Department> getListByParent(List<Department> parents);

    DepartmentDto getPrincipalForWxMsg(Long staffId);

    List<Department> getDeptByParent(Long parentId);

	int getDeptLevel(Long deptId);

	List<Long> getDeptIdsWithLevel(int level,Long deptId,Integer decisionRegion);

	List<Department> listDeptByParentId(Long companyId, Long deptId);

	List<Department> selectPartListByDto(DepartmentDto departmentDto);

	List<DepartmentDto> selectPrincipalNameByCompany(DepartmentDto departmentDto);
	
	Map<String, Object> getPrincipalByPartnerId(Long partnerId);

	List<Department> selectListByPermissionCodes(DepartmentDto departmentDto);

	List<Department> getChildDeptListByDeptId(Long deptId);

}
